<div class="main_box">
        <div class="add_question_box">
            <div class="submenu_t">
                    <ul>
                        <li><a href="?do=qlist">试题列表</a> | </li>
                        <li><a href="?do=add_q">添加试题库</a> | </li>
                        <li><a href="?do=addquestion">添加试题</a>|</li>
                        <li><a href="">批量导入</a></li>
                    </ul>
            </div>
                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="CContent">
                        <form action="?do=doadd_q" method="post" onsubmit="return checkbox_q()">
                        <tr>
                            <?php
                            if($_GET['qid']!=''){
                                $question_info_query = "select * from ".DBPREFIX."question where q_id=".$_GET['qid'];
                                $question_info_result = $db->query($question_info_query);
                                $question_info_array = array();
                                while($question_info_row = $db->fetch_array($question_info_result)){
                                    $question_info_row['q_option'] = explode('|',$question_info_row['q_option']);
                                  //  $question_info_row['answer'] ='1'.$question_info_row['answer'];
                                    $question_info_array = $question_info_row;
                                }
                            }
                            ?>
                                <td align="right">所属题库:</td>
                                <td colspan="2">
                                        <select name="question_db" id="question_db">
                                                <option value="0">请选择....</option>
                                                <?php
                                                $tiku_result = $db->query("select * from ".DBPREFIX."tiku where t_createuid=".$teacher_id);
                                                while($tiku_row = $db->fetch_array($tiku_result))
                                                        {
                                                ?> 
                                                <option value="<?php echo  $tiku_row['t_id'];?>" <?php if($question_info_array['q_tiku']==$tiku_row['t_id']) echo 'selected';?>><?php echo  $tiku_row['t_name']?></option>
                                                <?php
                                                        }
                                                ?>
                                        </select><a href="?do=add_q"><span class="t_underline">增加试题库<span></a>
                                </td>
                        </tr>
                        <tr>
                                <td align="right">题型:</td>
                                                <td colspan="2"><select name="question_type" id="question_type" id="question_type" onchange="choose_question_type()">
                                                <option value="0">请选择....</option>
                                                <option value="1" <?php if($question_info_array['q_type']==1) echo 'selected'?>>单选题</option>
                                                <option value="2" <?php if($question_info_array['q_type']==2) echo 'selected'?>>多选题</option>
                                                <option value="3" <?php if($question_info_array['q_type']==3) echo 'selected'?>>判断题</option>
                                 </select></td>
                        </tr>
                        <tr>
                                <td align="right">试题标题:</td>
                                <td colspan="2"><textarea id="q_title" name="q_title" id="q_title"><?php if($question_info_array['q_title']!='') echo $question_info_array['q_title']?></textarea></td>
                        </tr>
                         <tr>
                                <td colspan="3">
                                        <table width="100%" border="0" id="addtextarea" cellpadding="0" cellspacing="0" class="CContent">
                                              <tr>
                                                      <td colspan="3"><span class="cor_red">※<span class="cor_blue">&nbsp;&nbsp;如果该选项是正确答案,请勾选后面的选择框<span><br/><span class="cor_red">※</span><span class="cor_blue">&nbsp;&nbsp;如果选择框多余,请留空</span></td>
                                              </tr>
                                                <tr>
                                                <td align="right">答案A:</td>
                                                <td ><textarea  id="answer1" name="answer[]"><?php if($question_info_array['q_option'][0]!='') echo $question_info_array['q_option'][0]?></textarea></td>
                                                <td width="13%"><input type="checkbox"  name="rightanswer[]" value="A" <?php if(strpos($question_info_array['q_answer'],'A')!==false) echo 'checked'?> />正确答案</td>  
                                              </tr>
                                              <tr>
                                                <td align="right">答案B:</td>
                                                <td ><textarea  id="answer2" name="answer[]"> <?php if($question_info_array['q_option'][1]!='') echo $question_info_array['q_option'][1]?></textarea></td>
                                                <td width="13%"><input type="checkbox"  name="rightanswer[]" value="B" <?php if(strpos($question_info_array['q_answer'],'B')!==false) echo 'checked'?>/>正确答案</td>  
                                              </tr>
                                              <tr>
                                                <td align="right">答案C:</td>
                                                <td ><textarea  id="answer3" name="answer[]"><?php if($question_info_array['q_option'][2]!='') echo $question_info_array['q_option'][2]?></textarea></td>
                                                <td width="13%"><input type="checkbox"  name="rightanswer[]" value="C" <?php if((strpos($question_info_array['q_answer'],'C')!==false)) echo 'checked'?> />正确答案</td>  
                                              </tr>
                                              <tr>
                                                <td align="right">答案D:</td>
                                                <td ><textarea  id="answer4" name="answer[]"> <?php if($question_info_array['q_option'][3]!='') echo $question_info_array['q_option'][3]?></textarea></td>
                                                <td width="13%"><input type="checkbox"  name="rightanswer[]" value="D" <?php if(strpos($question_info_array['q_answer'],'D')!==false) echo 'checked'?>  />正确答案</td>  
                                              </tr>
                                              <tr>
                                                <td align="right">答案E:</td>
                                                <td ><textarea  id="answer5" name="answer[]"> <?php if($question_info_array['q_option'][4]!='') echo $question_info_array['q_option'][4]?></textarea></td>
                                                <td width="13%"><input type="checkbox"  name="rightanswer[]" value="E" <?php if(strpos($question_info_array['q_answer'],'E')!==false) echo 'checked'?>/>正确答案</td>  
                                              </tr>
                                              <tr>
                                                <td align="right">答案F:</td>
                                                <td ><textarea  id="answer6" name="answer[]"> <?php if($question_info_array['q_option'][5]!='') echo $question_info_array['q_option'][5]?></textarea></td>
                                                <td width="13%"><input type="checkbox"  name="rightanswer[]" value="F" <?php if(strpos($question_info_array['q_answer'],'F')!==false) echo 'checked'?>/>正确答案</td>  
                                              </tr>
                                        </table>
                                       
                                </td>
                        </tr>
                        <tr>
                                <td align="right">答案解析:</td>
                                <td colspan="2"><textarea rows="10" id="fenxi" cols="10" name="fenxi"><?php if($question_info_array['q_jiexi']!='') echo $question_info_array['q_jiexi']?></textarea></td>
                        </tr>
                        <tr>
                                <td  align="right">难易程度:</td><td colspan="2"><select name="is_easy">
                                                <option value="0" <?php if($question_info_array['q_diff']==0) echo 'selected' ?>>较容易</option>
                                                <option value="1" <?php if($question_info_array['q_diff']==1) echo 'selected' ?>>一般</option>
                                                <option value="2" <?php if($question_info_array['q_diff']==2) echo 'selected' ?>>较难</option>
                                                <option value="3" <?php if($question_info_array['q_diff']==3) echo 'selected' ?>>非常难</option>
                                        </select></td>
                        </tr>
                        <tr>
                                <td align="right">分值:</td><td colspan="2">
                                        <select name="score">
                                                <option value="1" <?php if($question_info_array['q_score']==1) echo 'selected' ?> >1</option>
                                                <option value="2" <?php if($question_info_array['q_score']==2) echo 'selected' ?>>2</option>
                                                <option value="3" <?php if($question_info_array['q_score']==3) echo 'selected' ?>>3</option>
                                                <option value="4" <?php if($question_info_array['q_score']==4) echo 'selected' ?>>4</option>
                                                <option value="5" <?php if($question_info_array['q_score']==5) echo 'selected' ?>>5</option>
                                                <option value="8" <?php if($question_info_array['q_score']==8) echo 'selected' ?>>8</option>
                                                <option value="10" <?php if($question_info_array['q_score']==10) echo 'selected' ?>>10</option>
                                                <option value="12" <?php if($question_info_array['q_score']==12) echo 'selected' ?>>12</option>
                                        </select>
                                    <input type="hidden" value="<?php echo $_GET['qid'] ?>" name="qid" />
                                </td>
                        </tr>
                        <tr>
                                <td colspan="3" align="center"><input type="submit" value="提交试题" name="submit"/></td>
                        </tr>
                        </form>
                </table>
        </div>
</div>
<script type="text/javascript">
        CKEDITOR.replace('q_title',{ height : '60px', width:'700px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' });
        CKEDITOR.replace( 'fenxi',{ height : '200px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
        CKEDITOR.replace( 'answer1',{ height : '100px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
        CKEDITOR.replace( 'answer2',{ height : '100px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
        CKEDITOR.replace( 'answer3',{ height : '100px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
        CKEDITOR.replace( 'answer4',{ height : '100px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
        CKEDITOR.replace( 'answer5',{ height : '100px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
        CKEDITOR.replace( 'answer6',{ height : '100px', width:'600px',toolbar:'MyToolbar',fontSize_sizes:'16/16px' } );
</script>